package com.noreply.demo.h2;

import lombok.Data;

import java.io.Serializable;

/**
 * @author noreply
 * @description
 * @datetime 2021/10/11 10:26
 */
@Data
public class LocationDto implements Serializable {
    private Long id;
    private String type;
    private double latitude;
    private double longtitude;

    public static LocationDto doToDto(LocationDO locationDO) {
        LocationDto locationDto = new LocationDto();
        locationDto.setId(locationDO.getId());
        locationDto.setType(locationDO.getType());
        locationDto.setLatitude(locationDO.getLatitude());
        locationDto.setLongtitude(locationDO.getLongtitude());
        return locationDto;
    }

    public static LocationDO dtoToDo(LocationDto dto) {
        LocationDO locationDO = new LocationDO();
        locationDO.setId(dto.getId());
        locationDO.setType(dto.getType());
        locationDO.setLatitude(dto.getLatitude());
        locationDO.setLongtitude(dto.getLongtitude());
        return locationDO;
    }
}
